package cn.xorange.commons.security.configuration;

import cn.xorange.commons.security.constants.CacheConstants;
import cn.xorange.commons.security.constants.SecurityConstants;
import cn.xorange.commons.security.enums.LoginType;
import cn.xorange.commons.security.enums.SysType;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.ArrayList;
import java.util.List;

/**
 * @author : yangjian
 * @date : 2023/5/10
 */

@ConfigurationProperties(prefix = "spring.security")
@Data
public class  SecurityProperties {

    // 全局
    /** 需要忽略安全认证地址集合 */
    private List<String> ignoreUrls = new ArrayList<>();
    private List<String> superUserNames = new ArrayList<>();
    /** 是否是多租户 */
    private boolean enableTenant;
    private String rememberMeKey;
    private String salt = "mickeyToken3587Salt";

    // 个性化
    /** 是否开启验证码 */
    private Boolean enableCaptcha = false;
    /** 默认2分钟*/
    private Long captchaExpire = CacheConstants.CAPTCHA;
    /** 默认30分钟*/
    private Long tokenExpire = 30 * 60 * 60L;
    private Integer errNum = 3;
    /** 登录错误锁定15分钟 */
    private Long clockTime = 15 * 60L;
    private String sysType;
    private String loginType;

}
